package com.wxapp.custom.service.controller.client;

import com.wxapp.common.constant.base.IBaseController;
import com.wxapp.common.constant.pojo.vm.ResultVm;
import com.wxapp.common.constant.pojo.vo.UserVo;
import com.wxapp.common.core.annotation.User;
import com.wxapp.custom.api.pojo.vm.custom.PCustomDetailVm;
import com.wxapp.custom.api.pojo.vo.custom.QCustomUpdateVo;
import com.wxapp.custom.service.service.CustomService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author lgl
 * @Description
 * @Datetime 2023/10/7 10:07
 * @Modified By
 */
@RestController
@RequestMapping("/client/custom")
@RequiredArgsConstructor
@Tag(name = "客户管理")
public class CustomClientController extends IBaseController {
    private final CustomService customService;

    @PutMapping("/update")
    @Operation(summary ="更新客户信息")
    public ResultVm<String> updateCustom(@Schema(hidden = true) @User UserVo userVo, @RequestBody QCustomUpdateVo vo) {
        return customService.updateCustom(userVo, vo);
    }
    @GetMapping("/detail")
    @Operation(summary ="得到客户详情")
    public ResultVm<PCustomDetailVm> detailCustom(@Schema(hidden = true) @User UserVo userVo, @RequestParam(value = "id", required = false) String id){
        return customService.detailCustom(userVo,id);
    }
}
